package ngames.com.sushitv.action;

import android.app.Activity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Toast;

import java.util.ArrayList;

import ngames.com.sushitv.Fragment.SearchFragment;
import ngames.com.sushitv.R;
import ngames.com.sushitv.base.BaseListAction;
import ngames.com.sushitv.core.ModelCallback;
import ngames.com.sushitv.view.ClearEditText;
import ngames.com.sushitv.view.DynamicTagFlowLayout;

/**
 * Created by Fearless on 2016/8/5.
 */
public class SearchFirstAction extends BaseListAction {
    private DynamicTagFlowLayout dynamicTagFlowLayout;
    //private ClearEditText clearEditText;
    private SearchFragment fragment;
    public SearchFirstAction(Activity activity, View baseView) {
        super(activity, baseView);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        dynamicTagFlowLayout= (DynamicTagFlowLayout) mBaseView.findViewById(R.id.dynamicTag_test);

        onRefreshData();
    }

    private void filterData(String s) {

    }

    @Override
    public void onRefreshData() {
        hotWord();
    }

    /**
     * 热词
     */
    private void hotWord() {
        getAppModel().hotword(new ModelCallback<ArrayList<String>>() {
            @Override
            public void onBeforeRequest(String urlTag) {

            }

            @Override
            public void onSuccess(ArrayList<String> data) {
                dynamicTagFlowLayout.setTags(data);
            }

            @Override
            public void onFailure(String errorEvent, String message) {

            }
        });
    }

    @Override
    public void loadMore() {

    }
}
